package com.interest.web.controller.business;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.interest.business.domain.vo.InterestCodeVo;
import com.interest.common.core.controller.BaseController;
import com.interest.common.core.domain.AjaxResult;
import com.interest.common.core.page.TableDataInfo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.interest.business.domain.InterestRedeemCode;
import com.interest.business.service.IInterestRedeemCodeService;

/**
 * 权益兑换码Controller
 * 
 * @author ruoyi
 * @date 2024-03-24
 */
@RestController
@RequestMapping("/business/code")
public class InterestRedeemCodeController extends BaseController
{
    @Autowired
    private IInterestRedeemCodeService interestRedeemCodeService;

    /**
     * 查询权益兑换码列表
     */
    @PreAuthorize("@ss.hasPermi('business:code:list')")
    @GetMapping("/list")
    public TableDataInfo list(InterestCodeVo interestRedeemCode)
    {
        startPage();
        List<InterestCodeVo> list = interestRedeemCodeService.selectInterestRedeemCodeList(interestRedeemCode);
        return getDataTable(list);
    }


    /**
     * 获取权益兑换码详细信息
     */
    @PreAuthorize("@ss.hasPermi('business:code:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(interestRedeemCodeService.selectInterestRedeemCodeById(id));
    }

}
